<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>找回密码</title>
<link rel="icon" href="__IMG__/favicon.ico" />
<link rel="stylesheet" href="__PLUGIN__/bootstrap/css/bootstrap.css" />
<link rel="stylesheet" href="__PLUGIN__/node-waves/waves.css" />
<link rel="stylesheet" href="__PLUGIN__/animate-css/animate.css" />
<link rel="stylesheet" href="__CSS__/font.css" />
<link rel="stylesheet" href="__CSS__/style.css" />
</head>
<body class="fp-page">
    <div class="page-loader-wrapper">
        <div class="loader">
            <div class="preloader">
                <div class="spinner-layer pl-red">
                    <div class="circle-clipper left">
                        <div class="circle"></div>
                    </div>
                    <div class="circle-clipper right">
                        <div class="circle"></div>
                    </div>
                </div>
            </div>
            <p>加载中...</p>
        </div>
    </div>
    <div class="fp-box">
        <div class="card">
            <div class="body">
                <form id="forgot_password" method="POST">
                    <div class="msg">找回密码</div>
                    <p>输入注册邮箱并提交，稍后将收到附带重置密码链接的邮件。</p>
                    <div class="input-group">
                        <span class="input-group-addon"><i class="material-icons">email</i></span>
                        <div class="form-line">
                            <input type="email" class="form-control" name="email" placeholder="邮箱" required autofocus>
                        </div>
                    </div>
                    <button class="btn btn-block btn-lg bg-pink waves-effect" type="submit">重置密码</button>
                    <div class="row m-t-20 m-b--5 align-center">
                        <a href="{:url('auth/login')}">登录！</a>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <script src="__PLUGIN__/jquery/jquery.min.js"></script>
    <script src="__PLUGIN__/bootstrap/js/bootstrap.js"></script>
    <script src="__PLUGIN__/node-waves/waves.js"></script>
    <script src="__PLUGIN__/jquery-slimscroll/jquery.slimscroll.js"></script>
    <script src="__PLUGIN__/jquery-validation/jquery.validate.js"></script>
    <script src="__PLUGIN__/jquery-validation/localization/messages_zh.js"></script>
    <script src="__JS__/admin.js"></script>
    <script>
    $(function() {
        $('#forgot_password').validate({
            debug: true,
            highlight: function(input) {
                $(input).parents('.form-line').addClass('error');
            },
            unhighlight: function(input) {
                $(input).parents('.form-line').removeClass('error');
            },
            errorPlacement: function(error, element) {
                $(element).parents('.input-group').append(error);
            },
            submitHandler: function(form) {
                $.post("{:url('auth/forget')}", $(form).serialize(), function(data) {
                    $('#forgot_password .msg').text(data.msg);
                    if (data.code == 1000) location.href = "{:url('auth/login')}";
                }, 'json');
            }
        });
    });
    </script>
</body>
</html>